<template>
  <div class="container">
    <h3 ref="mytitle">{{ username }}</h3>
    <p>性别：{{ sex }}</p>
    <p>年龄：{{ age }}</p>
    <hr />
  </div>
</template>

<script>
import clonedeep from 'lodash.clonedeep'
export default {
  data() {
    return {
      address: '北京',
      vusername: '',
    }
  },
  props: ['username', 'sex', 'age'],
  //   props: {
  //     username: String,
  //     sex: String,
  //     age: {
  //       type: Number,
  //       required: true,
  //       default: 99,
  //     },
  //   },
  methods: {},
  mounted() {
    console.log(this.$refs.mytitle)
    this.$refs.mytitle.style = 'color:red'
    console.log(this.username)
    this.vusername = clonedeep(this.username)
  },
  components: {},
}
</script>

<style scoped>
p {
  color: blue;
}
</style>
